<template>
	<view>
		<view class="container" v-if="listdata">
			<view class="topbox">
			</view>
			<view class="strip"></view>
			<view class="paycard">
				<view class="moneybox">
					<view class="moneynum">
						<view class="num">{{listdata.money_num}}</view>
						<view class="text">缴费金额(元）</view>
					</view>
					<view class="mini-icon">
						<image :src="listdata.image" class="icon-img"></image>
					</view>
				</view>
			</view>
			<view class="paycard1">
				<view class="infolist" v-for="(item,index) in listdata.order">
					<view class="text4">{{item.name}}</view>
					<view class="text4">{{item.value}}</view>
				</view>
			</view>
		</view>
		<view class="bgbox" v-if="!listdata">
			<view class="no_data_tip">
				<image style="width: 400rpx; height: 400rpx;margin: 0 100rpx;" src="../../../static/images/no_data.png" mode="widthFix" class="no_data_img"></image>
				<view class='no_tip_content'>暂无账单</view>
			</view>
		</view>
	</view>
</template>

<script>
	var common = require('../../../utils/common.js');
	var app = getApp();
	var _this;
	const getpaymentlist = () => {
		common.post('HouseApi&a=village_my_pay_info', {
			village_id: _this.village_id,
			pigcms_id: _this.pigcms_id,
			order_id: _this.order_id
		}, data => {
			console.log('++++', data)
			_this.listdata = data
		});
	};

	export default {
		data() {
			return {
				listdata: {},
				village_id: 0,
				pigcms_id: 0,
				actcolor: '',
				btn_style: '',
				order_id: 0,
			}
		},
		onShow() {
			// #ifdef H5
			common.hideWxShare()
			// #endif
		},
		onLoad(options) {
			_this = this;
			_this.order_id = options.order_id
			// #ifdef H5
			console.log('准备跳小程序页', _this);
			common.webToMiniapp(_this.route, options, 'redirect')
			// #endif

			common.setMainColor(_this, function(config) {
				_this.actcolor = config.config.mobile_head_color
				_this.btn_style = 'background-color: ' + _this.actcolor + ';box-shadow:0px 30rpx 30rpx -30rpx ' + _this.actcolor +
					';';

				const res = uni.getStorageSync('village_key');
				if (res) {
					_this.village_id = res.village_id;
					_this.pigcms_id = res.pigcms_id;
					_this.village_name = res.village_name;
				};

				// if(options.village_id && options.village_id != _this.village_id){
				// 	common.post('HouseApi&a=search_village', {
				// 		village_id: options.village_id
				// 	}, data => {
				// 		_this.village_logo = data.village_logo ? data.village_logo : data.wechat_share_img;
				// 		_this.village_id = options.village_id;
				// 		_this.village_name = options.village_name;
				// 		var res = {
				// 			village_id: _this.village_id,
				// 			village_name: _this.village_name,
				// 			village_logo: _this.village_logo
				// 		};
				// 		if(options.pigcms_id){
				// 			res.pigcms_id = options.pigcms_id;
				// 			_this.pigcms_id = options.pigcms_id;
				// 		}
				// 		uni.setStorageSync('village_key', res);

				// 		getlifePaylist();
				// 	});
				// 	return false;
				// }

				getpaymentlist()
			});
		},
		methods: {
			btnpay() {
				uni.navigateTo({
					url: "/pages/village/my/lifepayment?current=1"
				})
			},
		},
	}
</script>

<style>
	page {
		background: rgb(245, 245, 245);
	}

	.container {
		margin: 0;
		padding: 0;
	}

	.topbox {
		width: 100%;
		height: 200rpx;
		background-color: #2681f3;
	}

	.strip {
		margin: 0 16rpx;
		height: 20rpx;
		background-color: #116cde;
		opacity: 0.8;
		border-radius: 10rpx;
		margin-top: -150rpx;
		z-index: 99;
	}

	.paycard {
		margin: 0 30rpx;
		background-color: #ffffff;
		border-radius: 5rpx;
		margin-top: -8rpx;
		overflow: hidden;
		padding: 50rpx 30rpx;
	}

	.moneybox {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
	}

	.moneybox1 {
		margin-top: 20rpx;
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		align-items: center;
	}

	.moneynum {
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.moneynum1 {
		display: flex;
		flex-direction: column;
		justify-content: center;
		flex-grow: 3.5;
	}

	.num {
		font-size: 52rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 60rpx;
		letter-spacing: 0rpx;
		color: #333333;
	}

	.text {
		font-size: 26rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 60rpx;
		letter-spacing: 0rpx;
		color: #999999;
	}

	.num1 {
		font-size: 36rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 60rpx;
		letter-spacing: 0rpx;
		color: #333333;
	}

	.text1 {
		font-size: 24rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 60rpx;
		letter-spacing: 0rpx;
		color: #999999;
	}

	.paycard1 {
		margin: 0 30rpx;
		background-color: #ffffff;
		border-radius: 5rpx;
		margin-top: 10rpx;
		overflow: hidden;
		padding: 50rpx 30rpx;
	}

	.mini-icon {
		width: 80rpx;
		height: 80rpx;
	}

	.icon-img {
		width: 100%;
		height: 100%;
	}

	.infolist {
		display: flex;
		flex-direction: row;
		justify-content: space-between;
		align-items: center;
		border-bottom: 2rpx solid #f0f0f0;
	}
	.infolist:last-child {
		border-bottom: 0rpx solid #f0f0f0;
	}

	.text4 {
		font-size: 24rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 80rpx;
		letter-spacing: -1rpx;
		color: #ababab;
	}

	.text2 {
		font-size: 24rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 40rpx;
		letter-spacing: 0rpx;
		color: #999999;
		margin: 30rpx 40rpx 0rpx 40rpx;
	}

	.text3 {
		font-size: 24rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 40rpx;
		letter-spacing: 0rpx;
		color: #999999;
		margin: 0rpx 40rpx 30rpx 40rpx;
	}

	.btn {
		font-size: 32rpx;
		font-weight: normal;
		font-stretch: normal;
		line-height: 90rpx;
		letter-spacing: 0px;
		color: #ffffff;
		background-color: #2681f3;
		border-radius: 44rpx;
		margin: 0rpx 100rpx;
		margin-top: 100rpx;
		border: 0rpx;
	}
	.bgbox {
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		right: 0;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	.no_data_tip {
	}
	
	.no_tip_content {
		padding: 30rpx 18%;
		color: #919191;
		font-size: 24rpx;
		text-align: center;
	}
</style>
